package game_play_strategy.tools;

import game_play_strategy.tools.GameScreen.ChessSquare;

import java.util.ArrayList;

public class HandleGPSEvents 
{
	public String UpdateRealPosition(ArrayList<ChessSquare> chessSquare, double user_latitude, double user_longitude)
	{
		String square_name = "";
		for(int i = 0; i < chessSquare.size(); i++)
		{
			if(user_latitude >= chessSquare.get(i).get_real_start_X() && 
			   user_latitude < chessSquare.get(i).get_real_end_X() &&
			   user_longitude <= chessSquare.get(i).get_real_start_Y() &&
			   user_longitude > chessSquare.get(i).get_real_end_Y()
			   )
			{
				square_name = chessSquare.get(i).get_square_name();
				i = chessSquare.size();
			}
		}
		return square_name;
	}
	
	public boolean RealEvenVirtual(String real, String virtual)
	{
		if(real.matches(virtual))
			return true;
		else
			return false;
		
	}
}
